package com.company.service.impl;

import com.company.entity.Type;
import com.company.service.BaseService;
import com.company.service.Liebiao;
import com.company.utils.SericeFactory;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class xiaoshuoImpl implements Liebiao {



    @Override
    public void liebiao(List list) {
        List list1 = new ArrayList<>();
        Type type = new Type();
        type.setXuhao(1);
        type.setName("雪山飞虎");
        type.setZuozhe("金庸");
        type.setJianjie("长篇");
        list1.add(type);
        Type type2 = new Type();
        type2.setXuhao(2);
        type2.setName("顾夏金玉");
        type2.setZuozhe("顾夏");
        type2.setJianjie("短篇");
        list1.add(type2);








        Scanner sc = new Scanner(System.in);
        System.out.println("0.退出登录");
        System.out.println("1.言情");
        System.out.println("2.武侠");
        System.out.println("请选择：");
        int xuanze = sc.nextInt();
        switch (xuanze){
            case 1:
                System.out.println("------------言情小说列表开始------------");
                System.out.println("序号\t名称\t作者\t简介");
                for (int i = 0; i < list1.size(); i++) {
                    Type t =(Type) list1.get(i);

                    System.out.println(t.getXuhao()+"\t"+t.getName()+"\t"+t.getZuozhe()+"\t"+t.getJianjie());
                }
                ShangChuanImpl chuan = new ShangChuanImpl();
                chuan.liebiao(list);


                break;
            case 2:

                break;
            case 0:
                System.out.println("退出登录");
                BaseService baseService = SericeFactory.getService("start");

                break;
            default:
                System.out.println("输入有误重新输入：");
                xuanze = sc.nextInt();
                break;
        }
    }
}
